package Chapter6.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class TempralData implements Serializable {

	private static final long serialVersionUID = 1L;
	private Long id;
	private String name;
	private Date brithDay;
	private Date hour;
	private Date created;
	private Set<String> ortherName;

	public TempralData() {
	}

	public TempralData(String name, Date brithDay, Date hour, Date created) {
		this.name = name;
		this.brithDay = brithDay;
		this.hour = hour;
		this.created = created;
	}

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Temporal(TemporalType.DATE)
	public Date getBrithDay() {
		return brithDay;
	}

	public void setBrithDay(Date brithDay) {
		this.brithDay = brithDay;
	}

	@Temporal(TemporalType.TIME)
	public Date getHour() {
		return hour;
	}

	public void setHour(Date hour) {
		this.hour = hour;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@ElementCollection(fetch = FetchType.LAZY)
	public Set<String> getOrtherName() {
		return ortherName;
	}

	public void setOrtherName(Set<String> ortherName) {
		this.ortherName = ortherName;
	}

}
